@extends('admin.layouts.app')
@section('content')
    @component('admin.slots.table', ['page' => $users])
        <thead>
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>邮箱</th>
            <th>创建时间</th>
            <th>最近更新</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($users as $user)
            <tr>
                <td>{{ $user->id }}</td>
                <td>{{ $user->name }}</td>
                <td>{{ $user->email }}</td>
                <td>{{ $user->created_at }}</td>
                <td>{{ $user->updated_at }}</td>
                <td>
                    <a title="编辑" href="{{route('user.edit', ['id' => $user->id])}}"
                       class="text-navy ml-10"><i class="fa fa-edit"></i> 编辑</a>
                    {{--<a title="删除" href="javascript:;"--}}
                       {{--onclick="if (window.confirm('确认删除？删除后无法恢复！')) { $(this).next().submit() }"--}}
                       {{--class="text-danger ml-10"><i class="fa fa-trash-o"></i> 删除</a>--}}
                    {!! Form::open(['url' => route('user.destroy', ['id' => $user->id]), 'method' => 'delete']) !!}
                    {!! Form::close() !!}
                </td>
            </tr>
        @endforeach
        </tbody>
    @endcomponent
@endsection
